/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ui;
import javax.microedition.lcdui.*;
/**
 *
 * @author brararzl
 */
public class EcranAffichageMessage
{
    private Command commandExit;
    private Command commandBack;
    private StringItem message;
    private Form form;

    public EcranAffichageMessage(gen.Controleur cont)
    {
        this.form = new Form("Message");

        this.commandExit = new Command("Exit", Command.SCREEN,1);
        this.commandBack = new Command("Voltar", Command.SCREEN, 1);

        this.message = new StringItem("Message:","");

        this.form.append(this.message);

        this.form.addCommand(commandExit);
        this.form.addCommand(commandBack);

        this.form.setCommandListener(cont);
        this.message.setItemCommandListener(cont);

    }

    public Screen getScreen()
    {
        return this.form;
    }

    public Command getCommandExit()
    {
        return this.commandExit;
    }

    public Command getCommandBack()
    {
        return this.commandBack;
    }

    public void afficherMessage(String s)
    {
        this.message.setText("\n"+s);
    }
}
